//
//  ProblemHandlingItemModel.m
//  Utils
//
//  Created by enghou on 2018/4/14.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "ProblemHandlingItemModel.h"
#import "NSString+size.h"
@implementation ProblemHandlingItemModel
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.ids = [self contentForKey:@"id" withSource:source];
        self.time = [self contentForKey:@"newOccurDate" withSource:source];
        self.eventName = [self contentForKey:@"name" withSource:source];
        self.content = [self contentForKey:@"issueContent" withSource:source];
        self.type = [self contentForKey:@"listState" withSource:source];
        self.typeName = [self contentForKey:@"issueTypeName" withSource:source];
        self.sender = [self contentForKey:@"operator" withSource:source];
        self.height = 62 + [self.content caculateSizeWithFont:[UIFont systemFontOfSize:14] MaxSize:CGSizeMake(ScreenWidth - 40, CGFLOAT_MAX)].height + 50;
        self.stepStatusCode = [self contentForKey:@"stepStatusCode" withSource:source];
        self.accepted = [[source objectForKey:@"acceptance"]boolValue];
        self.stepId = [self contentForKey:@"issueStepId" withSource:source];
        NSString *operationList = [self contentForKey:@"operationList" withSource:source];
        self.operations = [operationList componentsSeparatedByString:@","];
    }
    return self;
}
@end
